(use dbi)
(use gauche.collection)

(define conn (dbi-connect "dbi:mysql:test;host=localhost"))
(define query (dbi-prepare conn "SELECT id, name FROM store"))
(define result (dbi-execute query))
(define getter (relation-accessor result))
(map (lambda (row)
       (list (getter row "id")
	     (getter row "name")))
     result)

(("1" "Los Angeles") ("2" "San Diego") ("3" "Boston"))




